using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class BatchPrefab : MonoBehaviour
{
    [MenuItem("Tools/BatchPrefab All Children")]
    public static void BatchPrefabs()
    {
        Transform tParent = ((GameObject)Selection.activeObject).transform;
        Object tempPrefab;
        int i = 0;
        foreach (Transform child in tParent)
        {
            tempPrefab = PrefabUtility.SaveAsPrefabAsset(child.gameObject, "Assets/Resources/Prefabs/Objtest/" + child.name + ".prefab");
            // tempPrefab = EditorUtility.ReplacePrefab(child.gameObject, tempPrefab);
            i++;
        }

    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
